<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../include/base.jsp"%>
<!DOCTYPE HTML>
<html>
<head>
	<meta charset="UTF-8">
	<title>欢迎使用CRM管理系统</title>
    <link rel="stylesheet" href="${basePath }/css/bootstrap.min.css" type="text/css" />
    <link rel="stylesheet" href="${basePath }/css/style.css" type="text/css" />
    <script type="text/javascript" src="${basePath }/js/jquery.min.js"></script>
    <script type="text/javascript" src="${basePath }/js/bootstrap.min.js"></script>
    <style type="text/css">
        .navbar {
            margin-bottom:0px;
        }
        .fieldset {
			position: absolute;
			margin-left: 290px;
			margin-top: 130px;
		}
        #btn {
			margin-left: 230px;
		}
    </style>
</head>
<body>
    <div class="navbar">
        <div class="navbar-inner">
            <div class="container">
                <a href="${basePath }/message" class="brand">凯盛CRM管理系统</a>
                <div class="nav-collapse">
                    <ul class="nav">
                        <li class="active"><a href="#">最新动态</a></li>
                        <li><a href="${basePath }/contacts/list">联系人</a></li>
                        <li><a href="${basePath }/task/list">日程安排</a></li>
                        <li><a href="${basePath }/deal/list">业务机会</a></li>
                    </ul>
                    <ul class="nav pull-right">
                        <li><a href="#">${user.username }</a></li>
                        <li class="divider-vertical"></li>
                        <li><a href="${basePath }/user/info">账号设置</a></li>
                        <li><a href="${basePath }/user/loginout">退出</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div id="content" class="container">
        <div class="span9">
            <ul class="breadcrumb" style="vertical-align:top">
                <li class="active">最新动态</li>
            </ul>
            <div class="well">
                <table id="table">
               		<c:forEach items="${messageList }" var="message">
	               		<tr>
	                        <td style="width:30%;text-align:center;">
	                        	<c:choose>
	                        		<c:when test="${message.type eq '任务完成' }">
			                        	<span class="label label-success">${message.type }</span>
	                        		</c:when>
	                        		<c:when test="${message.type eq '联系人评论' || message.type eq '业务机会评论' }">
			                        	<span class="label label-info">${message.type }</span>
	                        		</c:when>
	                        		<c:when test="${message.type eq '联系人回复' || message.type eq '业务机会回复' }">
			                        	<span class="label label-inverse">${message.type }</span>
	                        		</c:when>
	                        		<c:when test="${message.type eq '创建业务机会' }">
			                        	<span class="label label-important">${message.type }</span>
	                        		</c:when>
	                        		<c:when test="${message.type eq '追踪业务机会' }">
			                        	<span class="label label-warning">${message.type }</span>
	                        		</c:when>
	                        		<c:when test="${message.type eq '业务机会失败' }">
			                        	<span class="label">${message.type }</span>
	                        		</c:when>
	                        		<c:when test="${message.type eq '业务机会成功' }">
			                        	<span class="label label-success">${message.type }</span>
	                        		</c:when>
	                        	</c:choose>
	                        </td>
	                        <td style="width:55%">
	                            <c:if test="${message.title != null }">
	                            	<strong>${message.title }</strong><br/>
	                            </c:if>
	                            ${message.content }
	                        </td>
	                        <td class="pull-right" style="text-align:center">${message.createTime }</td>
	                    </tr>
               		</c:forEach>
                    
                </table>
            </div>
        </div>
        
        <div class="span3 well" style="padding-top:0px">
            <div class="box">
                <div class="head">今日任务</div>
                <ul style="list-style-type:none">
	                <c:choose>
	                	<c:when test="${todayTaskList.size() eq 0 }">
	                		<li>没有任务，赶快<a href="${basePath }/task/task-new">添加</a>吧</li>
	                	</c:when>
	                	<c:otherwise>
	                		<c:forEach items="${todayTaskList }" var="task">
			                	<li>
			                        ${task.title }(${task.endDate})
			                    </li>
		                	</c:forEach>
	                	</c:otherwise>
	                </c:choose>
                </ul>
            </div>
        </div>
        <div class="span3 well" style="padding-top:0px">
            <div class="box">
                <div class="head">未完成的任务</div>
                <ul style="list-style-type:none">
               		<c:choose>
	                	<c:when test="${notCompleteList.size() eq 0 }">
	                		<li>没有任务，赶快<a href="${basePath }/task/task-new">添加</a>吧</li>
	                	</c:when>
	                	<c:otherwise>
	                		<c:forEach items="${notCompleteList }" var="task">
			                	<li>
			                        ${task.title }(${task.endDate})
			                    </li>
		                	</c:forEach>
	                	</c:otherwise>
	                </c:choose>
                </ul>
            </div>
        </div>
    </div>
</body>
</html>
